package com.kuzan.autocloud.common.util;

/**
 * <p>Description: </p>
 *
 * @author kuzank
 */
public class ValidateUtil {


    public static boolean email(String email) {
        String regex = "[0-9A-Za-z][\\.-_0-9A-Za-z]*@[0-9A-Za-z]+(\\.[0-9A-Za-z]+)+";
        if (email != null && email.matches(regex)) {
            return true;
        }
        return false;
    }

    public static boolean phone(String phone) {
        String regex = "^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\\d{8}$";
        if (phone != null && phone.matches(regex)) {
            return true;
        }
        return false;
    }
}
